<template>
	<view class="container">
		<view class="comment">
			<textarea placeholder="请输入备注内容" v-model="desc" maxlength="50" />
			<view class="font"> {{txtVal}}/50</view>
			<button type="primary" @click="addComment">提交</button>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				treatmentStatu: { checked: true },
				txtVal: 0,
				desc:""
				

			}
		},
		onLoad(options) {
			this.desc = options.text
		},
		watch:{
			"desc":function(){
				this.txtVal = this.desc.length;
			}
		},
		
		methods: {
			descInput(){
				console.log(this.desc)
			    // this.txtVal = this.desc.length;
			},
			    
			addComment(){
				this.$api.prePage().setremark(this.desc)
				// console.log(this.desc)
				uni.navigateBack()
			}
		}
	}	
</script>

<style  lang="scss">
	page{background: #E9E9E9;}
	.tittel{
		display: flex;
		justify-content: space-between;
		width: 90%;
		margin: 0upx auto;
		padding: 10upx 0;
		padding-top: 66upx;
		.tiittleL{
			font-size: 34upx;
		}
		.tiittleR{
			color: #666;
			font-size: 27upx;
			switch{
				margin-left:20upx;
			}
		}
		
	}
	.comment{
		 width: 90%;
		 margin: 0upx auto;
		margin-top: 20upx;
		textarea{
			padding: 20upx 25upx;
			background: #fff;
			width: 100%;
			padding-bottom: 60upx;
		}
		button{
			margin: 60upx auto;
			background: #F0406F;
			border-radius:35upx;
			font-size: 28upx;
		}
		.font{
			text-align: right;
			margin: -60upx 20upx 0 0;
			position: relative;
			z-index: 10;
			color: #999999;
			font-size: 27upx;
			}
	}
</style>
